<?php
namespace ImiApp\Module\Member\Service\Base;

use Imi\Model\Model;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Table;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\Entity;

/**
 * 会员Token表 基类
 * @Entity
 * @Table(name="sc_user_token", id={"token"})
 * @DDL("CREATE TABLE `sc_user_token` (
  `token` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Token',
  `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `expiretime` int(10) DEFAULT NULL COMMENT '过期时间',
  PRIMARY KEY (`token`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT COMMENT='会员Token表'")
 * @property string $token Token
 * @property int $userId 会员ID
 * @property int $createtime 创建时间
 * @property int $expiretime 过期时间
 */
abstract class ScUserTokenBase extends Model
{
    /**
     * Token
     * token
     * @Column(name="token", type="varchar", length=50, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=false)
     * @var string
     */
    protected $token;

    /**
     * 获取 token - Token
     *
     * @return string
     */ 
    public function getToken()
    {
        return $this->token;
    }

    /**
     * 赋值 token - Token
     * @param string $token token
     * @return static
     */ 
    public function setToken($token)
    {
        $this->token = $token;
        return $this;
    }

    /**
     * 会员ID
     * user_id
     * @Column(name="user_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $userId;

    /**
     * 获取 userId - 会员ID
     *
     * @return int
     */ 
    public function getUserId()
    {
        return $this->userId;
    }

    /**
     * 赋值 userId - 会员ID
     * @param int $userId user_id
     * @return static
     */ 
    public function setUserId($userId)
    {
        $this->userId = $userId;
        return $this;
    }

    /**
     * 创建时间
     * createtime
     * @Column(name="createtime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $createtime;

    /**
     * 获取 createtime - 创建时间
     *
     * @return int
     */ 
    public function getCreatetime()
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建时间
     * @param int $createtime createtime
     * @return static
     */ 
    public function setCreatetime($createtime)
    {
        $this->createtime = $createtime;
        return $this;
    }

    /**
     * 过期时间
     * expiretime
     * @Column(name="expiretime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var int
     */
    protected $expiretime;

    /**
     * 获取 expiretime - 过期时间
     *
     * @return int
     */ 
    public function getExpiretime()
    {
        return $this->expiretime;
    }

    /**
     * 赋值 expiretime - 过期时间
     * @param int $expiretime expiretime
     * @return static
     */ 
    public function setExpiretime($expiretime)
    {
        $this->expiretime = $expiretime;
        return $this;
    }

}
